﻿<s:SurfaceWindow x:Class="SimonSurface.SurfaceWindow1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Sim="clr-namespace:Simon"      
    Title="SimonSurface"
    >
    <s:SurfaceWindow.Resources>
        <ImageBrush x:Key="WindowBackground" Stretch="Fill" Opacity="0.6" ImageSource="Resources/background.png"/> 
        <Style x:Key="ScatterViewItemStyle1" TargetType="{x:Type s:ScatterViewItem}">
            <Setter Property="Background" Value="#00000000"/>
            <Setter Property="BorderBrush" Value="#33000000"/>
            <Setter Property="Foreground" Value="#FF515151"/>
            <Setter Property="BorderThickness" Value="1,1,1,1"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="MinWidth" Value="48"/>
            <Setter Property="MinHeight" Value="48"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="ActivationTimeline">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
                                    <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
                                    <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                    <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="25"/>
                                </DoubleAnimationUsingKeyFrames>
                                <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                    <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
                                    <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="0,0,0,0"/>
                                </ThicknessAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#26000000"/>
                                    <SplineColorKeyFrame KeyTime="00:00:00.4500000" Value="#14000000"/>
                                </ColorAnimationUsingKeyFrames>
                                <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
                                    <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:01.1000000" Value="1.182,0.441"/>
                                </PointAnimationUsingKeyFrames>
                                <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
                                    <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:01.1000000" Value="1.929,0.949"/>
                                </PointAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="DeactivationTimeline">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
                                    <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
                                    <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
                                </DoubleAnimationUsingKeyFrames>
                                <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                    <SplineThicknessKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="-4,-4,-4,-4"/>
                                </ThicknessAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)">
                                    <SplineDoubleKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="0"/>
                                </DoubleAnimationUsingKeyFrames>
                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)">
                                    <SplineColorKeyFrame KeyTime="00:00:00.7500000" Value="#26000000"/>
                                </ColorAnimationUsingKeyFrames>
                                <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
                                    <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="00:00:00" Value="1.241,0.304"/>
                                    <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="-0.636,0.132"/>
                                    <SplinePointKeyFrame KeyTime="00:00:00.7750000" Value="-1.146,-0.035"/>
                                </PointAnimationUsingKeyFrames>
                                <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
                                    <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="00:00:00" Value="1.879,0.551"/>
                                    <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="0.018,0.291"/>
                                    <SplinePointKeyFrame KeyTime="00:00:00.7750000" Value="-0.492,0.124"/>
                                </PointAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid x:Name="container" RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}">
                            <Grid.RenderTransform>
                                <ScaleTransform ScaleX="1" ScaleY="1"/>
                            </Grid.RenderTransform>
                            <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="shadow" Opacity="0"  Margin="-4,-4,-4,-4" Color="#00000000" ShadowVector="{TemplateBinding ShadowVector}"/>
                            <Border x:Name="contentBorder" Opacity="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            </Border>
                            <Rectangle x:Name="Sheen" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="False" IsHitTestVisible="False" Opacity="0" Fill="Transparent"/>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.ExitActions>
                                    <BeginStoryboard x:Name="DeactivationTimeline_BeginStoryboard">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <SplineThicknessKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="-4,-4,-4,-4"/>
                                            </ThicknessAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)">
                                                <SplineDoubleKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)">
                                                <SplineColorKeyFrame KeyTime="00:00:00.7500000" Value="#26000000"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
                                                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="00:00:00" Value="1.241,0.304"/>
                                                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="-0.636,0.132"/>
                                                <SplinePointKeyFrame KeyTime="00:00:00.7750000" Value="-1.146,-0.035"/>
                                            </PointAnimationUsingKeyFrames>
                                            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
                                                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="00:00:00" Value="1.879,0.551"/>
                                                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="00:00:00.7500000" Value="0.018,0.291"/>
                                                <SplinePointKeyFrame KeyTime="00:00:00.7750000" Value="-0.492,0.124"/>
                                            </PointAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </MultiTrigger.ExitActions>
                                <MultiTrigger.EnterActions>
                                    <BeginStoryboard x:Name="ActivationTimeline_BeginStoryboard">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
                                                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
                                                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="25"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
                                                <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="0,0,0,0"/>
                                            </ThicknessAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="shadow" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)">
                                                <SplineColorKeyFrame KeyTime="00:00:00" Value="#26000000"/>
                                                <SplineColorKeyFrame KeyTime="00:00:00.4500000" Value="#14000000"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)">
                                                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:01.1000000" Value="1.182,0.441"/>
                                            </PointAnimationUsingKeyFrames>
                                            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Sheen" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)">
                                                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:01.1000000" Value="1.929,0.949"/>
                                            </PointAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </MultiTrigger.EnterActions>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsActive" Value="True"/>
                                    <Condition Property="ShowsActivationEffects" Value="True"/>
                                </MultiTrigger.Conditions>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Foreground" Value="#A5333333"/>
                                <Setter Property="BorderBrush" Value="#33000000"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style> 
    </s:SurfaceWindow.Resources> 
    <Grid Background="{StaticResource WindowBackground}" > 
        <s:ScatterView > 
            <s:ScatterViewItem Width="600" Height="600" Style="{DynamicResource ScatterViewItemStyle1}" MinHeight="120" MinWidth="120" >
                <Viewbox MinHeight="100" MinWidth="100">
                    <Sim:Simon  Width="600" Height="600" />
                </Viewbox>
            </s:ScatterViewItem>
        </s:ScatterView>
    </Grid>
</s:SurfaceWindow>
